<template>
  <view>
    <web-view
      src="https://duxinggj-1251133427.cos.ap-guangzhou.myqcloud.com/case/atx/kj/test.html"
     @message="message"
    ></web-view>
  </view>
</template>

<script>
export default {
  name: "testsc",
  data() {
    return {};
  },
  methods: {
    message() {
		console.log(1111)
     console.log()
    },
    sendMsgToWebview() {
      let tha = this;
      uni.scanCode({
        success: function (res) {
          const _funName = "msgFromUniapp",
            _data = {
              msg: res.result,
            };
          // 发送消息到网页端
          const currentWebview = tha.$scope.$getAppWebview().children()[0];
          currentWebview.evalJS(`${_funName}(${JSON.stringify(_data)})`);
        },
      });
    },
  },
};
</script>

<style></style>